#!/bin/sh

bg="FAFCFE"
fg="303193"
width=370
height=700
script="$(realpath "$0")"
script="${script%/*}/fmi-weather"
tmp="/tmp/${0##*/}.$$.html"
trap "rm $tmp" EXIT

$script -f html -o "fg=$fg,bg=$bg,width=$width" "$@" > "$tmp"

#~ export GTK_DEBUG=interactive 
yad --html --disable-search --print-uri --width=$width --height=$height --title=Weather --window-icon=weather --button=OK:0 --escape-ok --borders=0 \
--css="#yad-dialog-window.background, button { background: #$bg; color: #$fg; }" \
--uri=file://"$tmp" \
--wk-prop="load-icons-ignoring-image-load-setting b:FALSE" \
--wk-prop="enable-xss-auditor b:FALSE" \
--wk-prop="enable-write-console-messages-to-stdout b:FALSE" \
--wk-prop="enable-webaudio b:FALSE" \
--wk-prop="enable-webgl b:FALSE" \
--wk-prop="allow-modal-dialogs b:FALSE" \
--wk-prop="enable-webaudio b:FALSE" \
--wk-prop="enable-accelerated-2d-canvas b:FALSE" \
--wk-prop="enable-dns-prefetching b:FALSE" \
--wk-prop="enable-developer-extras b:FALSE" \
--wk-prop="enable-html5-database b:FALSE" \
--wk-prop="enable-html5-local-storage b:FALSE" \
--wk-prop="enable-hyperlink-auditing b:FALSE" \
--wk-prop="enable-javascript b:FALSE" \
--wk-prop="enable-plugins b:FALSE" \
--wk-prop="enable-cache b:FALSE" \
--wk-prop="enable-offline-web-application-cache b:FALSE" \
--wk-prop="enable-media-stream b:FALSE" \
--wk-prop="enable-site-specific-quirks b:FALSE" \
--wk-prop="enable-spatial-navigation b:FALSE" \
--wk-prop="enable-java b:FALSE" \
--wk-prop="enable-fullscreen b:FALSE" \
--wk-prop="enable-resizable-text-areas b:FALSE" \
--wk-prop="enable-tabs-to-links b:FALSE" \
--wk-prop="media-playback-requires-user-gesture b:TRUE" \
--wk-prop="enable-private-browsing b:TRUE" \
--wk-prop="enable-frame-flattening b:TRUE" \
--wk-prop="enable-smooth-scrolling b:TRUE"
#~ https://webkitgtk.org/reference/webkit2gtk/stable/class.Settings.html
